home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2008 January / Cybermycha 1_2008.iso / Data.cab / _ED0FA14700AA474DA0F4DBE24671815D < prev    next >
Encoding:
Text File  |  2004-03-18  |  1.2 KB  |  36 lines

  1. regc4f( 5, %daycolor_r, %daycolor_g, %daycolor_b, %sunvisibility )
  2. regc4f( 7, %ambient_r, %ambient_g, %ambient_b, %ambient_a )
  3.  
  4. pshader("
  5.  
  6. ps_1_4
  7.  
  8. texld r0, t0    ;RGB=terrain colormap, A=terrain lightmap
  9. texld r1, t1    ;terrain detail
  10. texld r2, t2    ;road detail
  11. texld r3, t3    ;detailmasks
  12. texld r4, t4    ;clouds
  13. texld r5, t5    ;road
  14.  
  15. lrp r1.rgb, r3.b, r2, r1    ;terrain detail blend road detail with detailmasks = R1.RGB blended details
  16. +mul r0.a, 1-r4.a, r0.a     ; clouds shadow * terrain lightmap  = R0.A static lighting
  17.  
  18. mul r0.rgb, r0, r1          ;terrain color * blended details    = R0.RGB terrain
  19. +mov_x4_sat r3.a, r5.a          ;road opacity mask              = R3.A road opacity mask
  20.  
  21. lrp r0.rgb, r3.a, r5, r0    ;terrain color blend road with road opacity mask = terrain & road
  22. +mul_sat r1.a, r5_bx2.a, c5.a     ;specular mask extraction
  23.  
  24. mul r1.a, r1.a, r0.a ;speculara * static lighting        = R1.A Masked specular
  25.  
  26. mad_sat r0.rgb, v1, r1.a, r0
  27. +mad_sat r0.a, r0.a, c7.b, c7.a ;ambient + static lighting       = R0.A static lighting
  28.  
  29. mul r4.rgb, r0.a, c5            ;day * static lighting          = R4.RGB world lighting
  30.  
  31. mul r0, r0, r4              ;light color
  32.  
  33.  
  34. ")
  35.  
  36.